﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using exMath.Common;

namespace exMath.Calculus
{
    public class RiemannIntegral : Integral
    {
        protected override double PerformIntegration(double n)
        {
            return BasicOperations.Sum(a, b, n, delegate(double x)
            {
                return _f(x) * (x - (x - n));
            });
        }

        public RiemannIntegral(MathFunction f, double a, double b) : base(f, a, b) { }

    }
}
